import { createSSRApp } from 'vue'
import TnIcon from '@tuniao/tnui-vue3-uniapp/components/icon/src/icon.vue'
import TnNavbar from '@tuniao/tnui-vue3-uniapp/components/navbar/src/navbar.vue'
import TnButton from '@tuniao/tnui-vue3-uniapp/components/button/src/button.vue'
import TnTabs from '@tuniao/tnui-vue3-uniapp/components/tabs/src/tabs.vue'
import TnTabsItem from '@tuniao/tnui-vue3-uniapp/components/tabs/src/tabs-item.vue'
import TnForm from '@tuniao/tnui-vue3-uniapp/components/form/src/form.vue'
import TnFormItem from '@tuniao/tnui-vue3-uniapp/components/form/src/form-item.vue'
import TnInput from '@tuniao/tnui-vue3-uniapp/components/input/src/input.vue'
import TnPopup from '@tuniao/tnui-vue3-uniapp/components/popup/src/popup.vue'
import TnLoading from '@tuniao/tnui-vue3-uniapp/components/loading/src/loading.vue'
import TnRadio from '@tuniao/tnui-vue3-uniapp/components/radio/src/radio.vue'
import TnRadioGroup from '@tuniao/tnui-vue3-uniapp/components/radio/src/radio-group.vue'
import TnLazyLoad from '@tuniao/tnui-vue3-uniapp/components/lazy-load/src/lazy-load.vue'
import TnRate from '@tuniao/tnui-vue3-uniapp/components/rate/src/rate.vue'
import TnModal from '@tuniao/tnui-vue3-uniapp/components/modal/src/modal.vue'
import TnEmpty from '@tuniao/tnui-vue3-uniapp/components/empty/src/empty.vue'
import TnOverlay from '@tuniao/tnui-vue3-uniapp/components/overlay/src/overlay.vue'
import TnImageUpload from '@tuniao/tnui-vue3-uniapp/components/image-upload/src/image-upload.vue'
import App from './App.vue'
// 导入 pinia 实例
import pinia from './stores'

export function createApp() {
  const app = createSSRApp(App)
  app.use(pinia)

  app.component('TnIcon', TnIcon)
  app.component('TnNavbar', TnNavbar)
  app.component('TnButton', TnButton)
  app.component('TnTabs', TnTabs)
  app.component('TnTabsItem', TnTabsItem)
  app.component('TnForm', TnForm)
  app.component('TnTabsItem', TnFormItem)
  app.component('TnInput', TnInput)
  app.component('TnPopup', TnPopup)
  app.component('TnLoading', TnLoading)
  app.component('TnRadio', TnRadio)
  app.component('TnRadioGroup', TnRadioGroup)
  app.component('TnLazyLoad', TnLazyLoad)
  app.component('TnRate', TnRate)
  app.component('TnModal', TnModal)
  app.component('TnEmpty', TnEmpty)
  app.component('TnOverlay', TnOverlay)
  app.component('TnImageUpload', TnImageUpload)
  return {
    app,
  }
}
